#!/python/env/python3.5/bin/python
# coding:utf-8
import itchat
import time, os, json
import requests

TBID_DIR_PATH = '/home/woody/tbid'
IMG_SAVE_PATH = '/home/woody'

def getWechatFriends():
    friends = itchat.get_friends(update=True)[1:]
    return friends

def sendPub(imgPath):
    friends = getWechatFriends()
    for friend in friends:
        if friend.NickName == '辉仔':
            itchat.send('测试', friend['UserName'])
            itchat.send("@img@%s" % imgPath, friend['UserName'])
            time.sleep(.5)

itchat.auto_login(True)

sendPub('/home/woody/534550078191.jpeg')

itchat.run()
